<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition template="layout/layout.xhtml">
	<ui:define name="content">

		<f:view locale="#{LocalizationController.locale}">

			<div class="" id="loginModal">
				<div class="modal-header">
					<h3><h:outputText value="#{msgs.Login1Title}"/></h3>
				</div>
				<div class="well">

					<ul class="nav nav-tabs" id="loginTab">
						<li class="active"><a href="#login" data-toggle="tab">Login</a></li>
						<li><a href="#create" data-toggle="tab"><h:outputText value="#{msgs.Login2tab}"/></a></li>
					</ul>
					<div id="myTabContent" class="tab-content">
						<div class="tab-pane active in" id="login">
							<form class="form-horizontal" action="j_security_check"
								method="post">
								<fieldset>
									<div id="legend">
										<legend>Login</legend>
									</div>
									<div class="control-group">
										<!-- Username -->
										<label class="control-label" for="username">e-mail</label>
										<div class="controls">
											<input type="text" id="username" name="j_username"
												placeholder="" class="input-xlarge"	/>
										</div>
									</div>

									<div class="control-group">
										<!-- Password-->
										<label class="control-label" for="password">password</label>
										<div class="controls">
											<input type="password" id="password" name="j_password"
												placeholder="" class="input-xlarge" />
										</div>
									</div>

									<div class="control-group">
										<!-- Button -->
										<div class="controls">
											<button type="submit" class="btn btn-success">Login</button>
										</div>
									</div>
								</fieldset>
							</form>
						</div>
						
						
						
						<div class="tab-pane fade" id="create">
							<h:form id="tab">
								<a4j:outputPanel styleClass="formErrorMessage"
									ajaxRendered="true">
									<h:outputText value="#{UserManagerController.userFormMessage}"
										rendered="#{UserManagerController.showUserFormMessage}" />
								</a4j:outputPanel>
								<div class="control-group">

									<label class="control-label" for="input_username"><h:outputText value="#{msgs.Login3Name}"/></label>
									<div class="controls">
										<h:inputText id="input_username"
											value="#{UserManagerController.user.name}" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input_surname"><h:outputText value="#{msgs.Login4Surname}"/></label>
									<div class="controls">
										<h:inputText id="input_surname"
											value="#{UserManagerController.user.surname}" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input_email">e-mail</label>
									<div class="controls">
										<h:inputText id="input_email"
											value="#{UserManagerController.user.eMail}" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input_password">Password</label>
									<div class="controls">
										<h:inputSecret id="input_password" redisplay="true"
											value="#{UserManagerController.user.password}" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input_password_confirm"><h:outputText value="#{msgs.Login5Confirm}"/></label>
									<div class="controls">
										<h:inputSecret id="input_password_confirm" redisplay="true"
											value="#{UserManagerController.confirmPassword}" />
									</div>
								</div>
								<div>
									<h:commandLink styleClass="btn btn-success" value="#{msgs.Login6CreaButton}"
										action="#{UserManagerController.createUser}" />
								</div>
							</h:form>
						</div>
					</div>
				</div>
			</div>
		</f:view>

	</ui:define>
</ui:composition>
</html>